package com.hjd.shop.exception;

import com.hjd.shop.constant.ShopCode;
import lombok.extern.slf4j.Slf4j;

/**
 * Created with IntelliJ IDEA.
 *
 * @author 胡江迪
 * Date: 2020/10/13 0013
 * Time: 22:45
 * Description:异常处理
 */
@Slf4j
public class CastException {
    public static void  cast(ShopCode shopCode) {
       log.error(shopCode.toString());
       throw new CustomerException(shopCode);
    }
    public static void cast(Boolean state,String msg){
        log.error(msg);
        throw new CustomerException(state,msg);
    }
}
